package com.example.commons.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.example.commons.entity.dto.Reply;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * @program: authority-v3.0.7
 * @ClassName:Comment
 * @description: 地图评论列表 实体类
 * @author:dyy
 * @Version 3.0
 **/

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_comment")
@Schema(title = "Comment对象", description = "地图评论列表")
public class Comment implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(title = "序列号")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty("序列号")
    private Long id;

    @Schema(title = "发表用户")
    @TableField("uid")
    @ExcelProperty("发表用户")
    private Long uid;

    @Schema(title = "发布内容")
    @TableField("content")
    @ExcelProperty("发布内容")
    private String content;

    @Schema(title = "父级内容")
    @TableField("parentId")
    @ExcelProperty("父级内容")
    private Long parentId;

    @Schema(title = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @Schema(title = "所属地图")
    @TableField("aid")
    @ExcelProperty("所属地图")
    private Long aid;

    @Schema(title = "所属视频")
    @TableField("vid")
    @ExcelProperty("所属视频")
    private Long vid;

    @TableField(exist = false)
    @ExcelIgnore
    private User user = new User();

    @TableField(exist = false)
    @ExcelIgnore
    private Reply reply = new Reply();
}
